# apps/user/admin.py
from django.contrib import admin
from .models import Family, FamilyMember, InvitationCode
from .models import UserProfile, UserPreference, SessionLog

@admin.register(Family)
class FamilyAdmin(admin.ModelAdmin):
    list_display = ('id', 'name', 'manager', 'description')

@admin.register(FamilyMember)
class FamilyMemberAdmin(admin.ModelAdmin):
    list_display = ('user', 'family', 'role', 'joined_at')

@admin.register(InvitationCode)
class FamilyMemberInvitationCodeAdmin(admin.ModelAdmin):
    list_display = ('code', 'family', 'created_by', 'created_at','expires_at', 'used')

@admin.register(UserProfile)
class UserProfileAdmin(admin.ModelAdmin):
    list_display = ('user', 'nickname', 'onboard_completed')

@admin.register(UserPreference)
class UserPreferenceAdmin(admin.ModelAdmin):
    list_display = ('user', 'key', 'value')

@admin.register(SessionLog)
class SessionLogAdmin(admin.ModelAdmin):
    list_display = ('user', 'login_at', 'logout_at', 'ip')